﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;

namespace IDE_week2_Forms_project
{
    public partial class Form1 : Form
    {
        public Form1()
        {
             
            InitializeComponent();
           
        }
        int counter = 0;

        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }


        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {

        }

        private void button3_Click(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {

        }
       

        private void button2_Click_1(object sender, EventArgs e)
        {
            Form2 My_newform= new Form2(); 
            My_newform.Show();
            //Form2.E
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            Icon = Properties.Resources.Icon1;
        }

        private void button3_Click_1(object sender, EventArgs e)
        {
            Icon = default(Icon);
        }

        private void button5_Click(object sender, EventArgs e)
        {
            if (counter == 0)

            { ChangeLanguage("ar");
            counter = 1;
            }
            else if (counter == 1)
            {
                ChangeLanguage("en");
                counter = 0;
            }
            

        }

        private void button4_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            textBox1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];
           

        }

       
    }
}
